#猜大小.py
import random
num = random.randint(1,1000)
times = 0
while True:
    n = input("猜大小(%d-%d)："%(1,1000))
    n = int(n)
    times += 1
    if n<num:
        print("猜小了。")
    elif n>num:
        print("猜大了。")
    else:
        print("猜对了！")
        print("总共猜了%d次"%(times))
    break